<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script type="text/javascript">
		var arr = [1, 2, 3, 4, 5];
		var add = arr.reduce(function(total, num) {
			return num+ total
		}, 1)
		console.log(add)
	</script>
</body>
</html>